function validityCheck()
{
	var checkedForm = document.getElementById("updateForm");
	
	var checkBoxes = document.getElementsByTagName("input");
	
	var flag = false;
	
	for (var i = 0 ; i < checkBoxes.length ; i++)
	{
		if (checkBoxes[i].type == "checkbox")
		{
			if (checkBoxes[i].checked)
			{
				flag = true;
				break;
			}
		}
	}
	
	if (false == flag)
	{
		alert("You haven't checked any of the boxes...");
		return false;
	}
	
	// Emptiness check
	if (checkedForm.elements["change_password"].checked)
	{
		if (checkedForm.elements["change_password_value"].value.length == 0 ||
			checkedForm.elements["change_password_confirm_value"].value.length == 0)
		{
			alert("At least one of the password is empty, please retype");
			return false;
		}
		if (checkedForm.elements["change_password_value"].value !=
			checkedForm.elements["change_password_confirm_value"].value)
		{
			alert("Passwords don't match, please retype");
			return false;
		}
	}
	
	if (checkedForm.elements["change_first_name"].checked &&
		checkedForm.elements["change_first_name_value"].value.length == 0)
	{
		alert("First name is empty, please retype");
		return false;
	}
	
	if (checkedForm.elements["change_last_name"].checked &&
		checkedForm.elements["change_last_name_value"].value.length == 0)
	{
		alert("Last name is empty, please retype");
		return false;		
	}

	if (checkedForm.elements["change_phone_number"].checked &&
		checkedForm.elements["change_phone_number_value"].value.length == 0)
	{
		alert("Phone number is empty, please retype");
		return false;		
	}

	if (checkedForm.elements["change_address"].checked &&
		checkedForm.elements["change_address_value"].value.length == 0)
	{
		alert("Address is empty, please retype");
		return false;		
	}
	
	if (checkedForm.elements["change_phone_number"].checked)
	{
		var nonums = /^[0-9]*$/;
		if (false == nonums.test(checkedForm.elements["change_phone_number_value"].value))
		{
			alert("Please insert only numeric values in the phone number...");
			return false;
		}
	}
	return true;
}

function passwordBoxClick()
{
	var checkedForm = document.getElementById("updateForm");
	if (checkedForm.elements["change_password"].checked)
	{
		checkedForm.elements["change_password_confirm"].checked = true;
	}
	else
	{
		checkedForm.elements["change_password_confirm"].checked = false;
	}
}